/*
 * @Author: liuzibin
 * @Date: 2023-07-27 00:56:27
 * @Descroption: 完善用户信息
 */
const axios = require("axios");

async function perfectMerchantInfo({ merchantToken, phone, address }) {
  const response = await axios.post(
    "https://borderclear.cn/mer/info/update",
    {
      mer_banner:
        "https://borderclear.cn/uploads/def/20230727/b6a69b48f0561eabac087cab1f0dc46f.png",
      mer_avatar:
        "https://borderclear.cn/uploads/def/20230727/b6a69b48f0561eabac087cab1f0dc46f.png",
      mer_info: "---",
      mer_keyword: "",
      mer_address: address,
      uploadedqualifications: 1,
      delivery_way: ["2"],
      mer_take_name: "",
      mer_take_day: [],
      mer_take_time: ["", ""],
      mer_take_phone: "",
      mer_take_address: "",
      mer_take_location: [],
      mer_state: 1,
      long: 108.93984,
      lat: 34.34127,
      mini_banner: null,
      service_phone: phone,
      type: "2",
      mer_certificate: [
        "https://borderclear.cn/uploads/attach/20230727/fa98323e424d0678dc4f66781698d27f.png",
      ],
    },
    {
      headers: {
        Accept: "application/json, text/plain, */*",
        Referer: "http://borderclear.cn/admin/merchant/list",
        "X-Token": merchantToken,
        "User-Agent":
          "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
        "Content-Type": "application/json;charset=UTF-8",
      },
    }
  );
  console.log(response.data);

  return true;
}

module.exports = perfectMerchantInfo;
